package com.market.mapper;

import com.market.entity.Order;
import org.apache.ibatis.annotations.Mapper;

import java.util.Date;
import java.util.List;

@Mapper
public interface OrderMapper {
    //新增一条订单记录
    boolean addOrder(Order order);

    //通过订单id查询一笔订单
    Order queryOrderByOrderId(int id);

    //通过订单编号查询一笔订单
    Order queryOrderByOrderCode(String orderCode);

    //查看所有订单
    List<Order>queryAllOrders();

    //通过买家id查询所有已下订单
    List<Order> queryAllBuyerOrders(int buyerId);

    //查询当天8点~18点已付款的订单
    List<Order>queryDayOrders(String payTime);

    //通过订单id修改订单付款时间
    boolean updateOrderPayTime(int id,String payTime);

    //修改订单最终成交时间
    boolean updateOrderFinishTime(int id,String finishTime);

    //修改订单状态码
    boolean updateOrderState(int id,int state);

    //修改订单配送小店id
    boolean updateStoreId(int id,int storeId);

    //删除订单
    boolean deleteOrder(int id);

    int updateActualPay(double money,int orderId);

    int updateShouldPayment(double money, int orderId);
}
